Extension point command
Documentation
Extension point to contribute new commands.
Available options are: - name: string attribute used as the command identifier.
- enabled: boolean attribute, command is unavailable if false.
- commandLine: the command to execute.
- parameterString: the parameters to pass to the command. Parameters like #{parameter} represents a file. So you can use either a path to a file or a blob. Parameters like %parameters are literals.
- winParameterString: Same as above but used in windows environments. For instance you have to use double quotes in windows instead of simple quote.
- winCommand: command to execute specifically for windows. Use commandLine is WinCommand is null;
@since 8.4 - testParameterString: the parameters to pass to the CommandTester. The CommandTester will run the command with these params
@since 8.4 - winTestParameterString: same as above but used in windows environments.
- tester: name of the CommandTester. The CommandTester defined in commandTester extension point. Default is DefaultCommandTester, which looks if the command is available.
- readOutput: Boolean, default is true. If false, command output is never read.
- installationDirective: a String that is returned instead of the usual output when the command isn't available.
CommandLine contribution example:
<command enabled="true" name="myCommand">
<commandLine>commandName</commandLine>
<parameterString> -any -parameters '%specific' %parameters #{blobOrPath}</parameterString>
<winParameterString> -any -parameters "%specific" %parameters " #{blobOrPath}</winParameterString>
<testParameterString> -any -parameters</testParameterString>
<winTestParameterString> -any -specific -windows -parameters</winTestParameterString>
<installationDirective>You need to install commandName.</installationDirective>
</command>
Contribution Descriptors
- Class: org.nuxeo.ecm.platform.commandline.executor.service.CommandLineDescriptor
Existing Contributions
Contributions are presented in the same order as the registration order on this extension point. This order is displayed before the contribution name, in brackets.
-
<extension point="command" target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent"> <command enabled="true" name="blender_pipeline"> <commandLine>docker</commandLine> <testParameterString>pull nuxeo/blender</testParameterString> <parameterString>run --name #{name} --volumes-from #{data} nuxeo/blender -P /scripts/#{scriptFile} -- --input /in/#{inFile} --outdir /out --operators #{operators} --renderids #{renderIds} -li #{lodIds} -pp #{percPoly} -mp #{maxPoly} -d #{dimensions} -c #{coords} </parameterString> <installationDirective>Please, install docker (https://www.docker.com/) </installationDirective> </command> <command enabled="true" name="collada2gltlf"> <commandLine>docker</commandLine> <testParameterString>pull nuxeo/collada2gltf</testParameterString> <parameterString>run --name #{name} --volumes-from #{data} nuxeo/collada2gltf -f /in/#{inFile} -o /out/#{outFile} -e</parameterString> <installationDirective>Please, install docker (https://www.docker.com/) </installationDirective> </command> <command enabled="true" name="create_container"> <commandLine>docker</commandLine> <testParameterString>version</testParameterString> <parameterString>create --name #{name} #{image} </parameterString> <installationDirective>Please, install docker (https://www.docker.com/) </installationDirective> </command> <command enabled="true" name="remove_container"> <commandLine>docker</commandLine> <testParameterString>version</testParameterString> <parameterString>rm #{name} </parameterString> <installationDirective>Please, install docker (https://www.docker.com/) </installationDirective> </command> <command enabled="true" name="copy_container"> <commandLine>docker</commandLine> <testParameterString>version</testParameterString> <parameterString>cp #{source} #{destination}</parameterString> <installationDirective>Please, install docker (https://www.docker.com/) </installationDirective> </command> <command enabled="true" name="useruid"> <commandLine>id</commandLine> <testParameterString>-u</testParameterString> <parameterString>-u #{username}</parameterString> <installationDirective>Please, install id command</installationDirective> </command> </extension>
-
<extension point="command" target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent"> <command enabled="true" name="pdftotext"> <commandLine>pdftotext</commandLine> <parameterString>-enc UTF-8 #{sourceFilePath} #{targetFilePath}</parameterString> <winParameterString>-enc UTF-8 #{sourceFilePath} #{targetFilePath}</winParameterString> <installationDirective>You need to install pdftotext.</installationDirective> </command> <command enabled="true" name="ps2pdf"> <commandLine>gs</commandLine> <winCommand>gswin64c</winCommand> <parameterString>-dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dEPSFitPage -sOutputFile=#{targetFilePath} #{sourceFilePath}</parameterString> <installationDirective>You need to install GhostScript.</installationDirective> </command> </extension>
-
<extension point="command" target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent"> <command enabled="true" name="exiftool-read-taglist"> <commandLine>exiftool</commandLine> <parameterString>-m -q -q -G -json #{tagList} #{inFilePath}</parameterString> <installationDirective>You need to install exiftool</installationDirective> </command> <command enabled="true" name="exiftool-read"> <commandLine>exiftool</commandLine> <parameterString>-m -q -q -G -json #{inFilePath}</parameterString> <installationDirective>You need to install exiftool</installationDirective> </command> <command enabled="true" name="exiftool-write"> <commandLine>exiftool</commandLine> <parameterString>-m -q -q -G -overwrite_original #{tagList} #{inFilePath}</parameterString> <installationDirective>You need to install exiftool</installationDirective> </command> <!-- Since 7.3 --> <command enabled="true" name="exiftool-read-taglist-noprefix"> <commandLine>exiftool</commandLine> <parameterString>-m -q -q -json #{tagList} #{inFilePath}</parameterString> <installationDirective>You need to install exiftool</installationDirective> </command> <!-- Since 7.3 --> <command enabled="true" name="exiftool-read-noprefix"> <commandLine>exiftool</commandLine> <parameterString>-m -q -q -json #{inFilePath}</parameterString> <installationDirective>You need to install exiftool</installationDirective> </command> <!-- Since 7.3 --> <command enabled="true" name="exiftool-write-noprefix"> <commandLine>exiftool</commandLine> <parameterString>-m -q -q -overwrite_original #{tagList} #{inFilePath}</parameterString> <installationDirective>You need to install exiftool</installationDirective> </command> </extension>
-
<extension point="command" target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent"> <command enabled="true" name="converter"> <commandLine>convert</commandLine> <parameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet #{inputFilePath}[0] #{outputFilePath}</parameterString> <winParameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet #{inputFilePath}[0] #{outputFilePath}</winParameterString> <installationDirective>You need to install ImageMagick.</installationDirective> </command> </extension>
-
<extension point="command" target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent"> <command enabled="true" name="pdftohtml"> <commandLine>pdftohtml</commandLine> <parameterString> -c -nodrm -enc UTF-8 -noframes #{inFilePath} #{outDirPath}/index.html</parameterString> <winParameterString> -c -nodrm -enc UTF-8 -noframes #{inFilePath} #{outDirPath}\index.html</winParameterString> <installationDirective>You need to install pdftohtml</installationDirective> </command> </extension>
-
<extension point="command" target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent"> <command enabled="true" name="wpd2text"> <commandLine>wpd2text</commandLine> <parameterString> #{inFilePath}</parameterString> <installationDirective>You need to install wpd2text (deb: libwpd-tools) http://libwpd.sourceforge.net/download.html</installationDirective> </command> </extension>
-
<extension point="command" target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent"> <command enabled="true" name="soffice"> <commandLine>soffice</commandLine> <winCommand>soffice.exe</winCommand> <parameterString>--headless --norestore --writer --convert-to #{format} #{sourceFilePath} --outdir #{outDirPath} -env:UserInstallation=#{userInstallation}</parameterString> <testParameterString>--version</testParameterString> <winTestParameterString>--headless --cat test</winTestParameterString> <installationDirective>You need to install LibreOffice and add soffice to the PATH environment variable. </installationDirective> </command> </extension>
-
<extension point="command" target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent"> <command enabled="true" name="identify"> <commandLine>identify</commandLine> <parameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -ping -format '%m %w %h %z %[colorspace]' #{inputFilePath}[0]</parameterString> <winParameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -ping -format "%m %w %h %z %[colorspace]" #{inputFilePath}[0]</winParameterString> <installationDirective>You need to install ImageMagick.</installationDirective> </command> <command enabled="true" name="crop"> <commandLine>stream</commandLine> <parameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -map rgb -storage-type char -extract #{tileWidth}x#{tileHeight}+#{offsetX}+#{offsetY} #{inputFilePath}[0] - | convert -depth 8 -size #{tileWidth}x#{tileHeight} rgb:- #{outputFilePath}</parameterString> <winParameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -map rgb -storage-type char -extract #{tileWidth}x#{tileHeight}+#{offsetX}+#{offsetY} #{inputFilePath}[0] - | convert -depth 8 -size #{tileWidth}x#{tileHeight} rgb:- #{outputFilePath}</winParameterString> <installationDirective>You need to install ImageMagick.</installationDirective> </command> <command enabled="true" name="resizer"> <commandLine>convert</commandLine> <parameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -depth #{targetDepth} #{inputFilePath}[0] jpg:- | convert - -resize #{targetWidth}x#{targetHeight} #{outputFilePath}</parameterString> <winParameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -depth #{targetDepth} #{inputFilePath}[0] -resize #{targetWidth}x#{targetHeight} #{outputFilePath}</winParameterString> <installationDirective>You need to install ImageMagick.</installationDirective> </command> <command enabled="true" name="gifResizer"> <commandLine>convert</commandLine> <parameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -depth #{targetDept h} #{inputFilePath}[0] -coalesce -resize #{targetWidth}x#{targetHeight} -deconstruct #{outputFilePath}</parameterString> <installationDirective>You need to install ImageMagick.</installationDirective> </command> <command enabled="true" name="jpegResizer"> <commandLine>convert</commandLine> <parameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -background white -flatten -depth #{targetDepth} #{inputFilePath}[0] jpg:- | convert - -resize #{targetWidth}x#{targetHeight} #{outputFilePath}</parameterString> <winParameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -background white -flatten -depth #{targetDepth} #{inputFilePath}[0] -resize #{targetWidth}x#{targetHeight} #{outputFilePath}</winParameterString> <installationDirective>You need to install ImageMagick.</installationDirective> </command> <command enabled="true" name="rotate"> <commandLine>convert</commandLine> <parameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet #{inputFilePath}[0] -rotate #{angle} #{outputFilePath}</parameterString> <winParameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet #{inputFilePath}[0] -rotate #{angle} #{outputFilePath}</winParameterString> <installationDirective>You need to install ImageMagick.</installationDirective> </command> <command enabled="true" name="cropAndResize"> <commandLine>stream</commandLine> <parameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -map #{mapComponents} -storage-type char -extract #{tileWidth}x#{tileHeight}+#{offsetX}+#{offsetY} #{inputFilePath}[0] - | convert -depth 8 -size #{tileWidth}x#{tileHeight} -resize #{targetWidth}x#{targetHeight}! #{mapComponents}:- #{outputFilePath}</parameterString> <installationDirective>You need to install ImageMagick.</installationDirective> </command> <command enabled="true" name="multiTiler"> <commandLine>convert</commandLine> <parameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet #{inputFilePath}[0] -crop #{tileWidth}x#{tileHeight} +repage #{outputFilePath}</parameterString> <installationDirective>You need to install ImageMagick.</installationDirective> </command> </extension>
-
<extension point="command" target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent"> <command enabled="true" name="ffmpeg-info"> <commandLine>ffprobe</commandLine> <parameterString> #{inFilePath}</parameterString> <installationDirective>You need to install ffmpeg from http://ffmpeg.org (apt-get install ffmpeg) </installationDirective> </command> <command enabled="true" name="ffmpeg-screenshot"> <commandLine>ffmpeg</commandLine> <!-- It's important to put the -ss option before the -i option for faster (though less accurate) seek / skip to position in the input file --> <parameterString> -y -ss #{position} -i #{inFilePath} -vframes 1 -f image2 #{outFilePath}</parameterString> <installationDirective>You need to install ffmpeg from http://ffmpeg.org (apt-get install ffmpeg) </installationDirective> </command> <command enabled="true" name="ffmpeg-screenshot-resize"> <commandLine>ffmpeg</commandLine> <!-- It's important to put the -ss option before the -i option for faster (though less accurate) seek / skip to position in the input file. The -vframes 1 option tell to take only one screenshot. This is necessary as apparent the use of the "-s" option forces ffmpeg to switch in "many output files" mode. --> <parameterString> -y -ss #{position} -i #{inFilePath} -vframes 1 -f image2 -s #{width}x#{height} #{outFilePath}</parameterString> <installationDirective>You need to install ffmpeg from http://ffmpeg.org (apt-get install ffmpeg) </installationDirective> </command> <command enabled="true" name="ffmpeg-towebm"> <commandLine>ffmpeg</commandLine> <parameterString> -i #{inFilePath} -s #{width}x#{height} -acodec libvorbis -v 0 #{outFilePath}</parameterString> <installationDirective>You need to install ffmpeg from http://ffmpeg.org (apt-get install ffmpeg) </installationDirective> </command> <command enabled="true" name="ffmpeg-tomp4"> <commandLine>ffmpeg</commandLine> <parameterString> -i #{inFilePath} -s #{width}x#{height} -acodec aac -strict -2 -pix_fmt yuv420p -vcodec libx264 -v 0 #{outFilePath}</parameterString> <winParameterString> -i #{inFilePath} -s #{width}x#{height} -pix_fmt yuv420p -vcodec libx264 -v 0 #{outFilePath}</winParameterString> <installationDirective>You need to install ffmpeg from http://ffmpeg.org (apt-get install ffmpeg) </installationDirective> </command> <command enabled="true" name="ffmpeg-toogg"> <commandLine>ffmpeg</commandLine> <parameterString> -i #{inFilePath} -s #{width}x#{height} -acodec libvorbis -v 0 #{outFilePath}</parameterString> <installationDirective>You need to install ffmpeg from http://ffmpeg.org (apt-get install ffmpeg) </installationDirective> </command> <command enabled="true" name="ffmpeg-toavi"> <commandLine>ffmpeg</commandLine> <parameterString> -i #{inFilePath} -s #{width}x#{height} -q:v 0 -c:v mpeg4 -c:a ac3 #{outFilePath}</parameterString> <installationDirective>You need to install ffmpeg. </installationDirective> </command> </extension>
-
<extension point="command" target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent"> <command enabled="true" name="videoClosedCaptionsExtractor"> <commandLine>ccextractor</commandLine> <parameterString>#{sourceFilePath} -out=#{outFormat} -trim -o #{outFilePath} </parameterString> <installationDirective>You need to install ccextractor.</installationDirective> </command> <command enabled="true" name="videoPartClosedCaptionsExtractor"> <commandLine>ccextractor</commandLine> <parameterString>#{sourceFilePath} -out=#{outFormat} -startat #{startAt} -endat #{endAt} -trim -o #{outFilePath} </parameterString> <installationDirective>You need to install ccextractor.</installationDirective> </command> <command enabled="true" name="videoConcat"> <commandLine>ffmpeg</commandLine> <parameterString>-y -f concat -safe 0 -i #{listFilePath} -c copy #{outFilePath}</parameterString> <installationDirective>You need to install ffmpeg.</installationDirective> </command> <!-- This one is very fast, but you may miss frames. Use it when you are sure you'll get the correct cut --> <command enabled="true" name="videoSlicerByCopy"> <commandLine>ffmpeg</commandLine> <parameterString>-y -i #{sourceFilePath} -ss #{startAt} -t #{duration} -c copy #{outFilePath}</parameterString> <installationDirective>You need to install ffmpeg.</installationDirective> </command> <!-- This on is the basic slicing. It re-encodes the video, so it it is slower than videoSlicerCopy --> <command enabled="true" name="videoSlicer"> <commandLine>ffmpeg</commandLine> <parameterString>-y -i #{sourceFilePath} -ss #{startAt} -t #{duration} #{outFilePath}</parameterString> <installationDirective>You need to install ffmpeg.</installationDirective> </command> <!-- This enables video slicing starting from the specific time --> <command enabled="true" name="videoSlicerStartAt"> <commandLine>ffmpeg</commandLine> <parameterString>-y -i #{sourceFilePath} -ss #{startAt} #{outFilePath}</parameterString> <installationDirective>You need to install ffmpeg.</installationDirective> </command> <!-- Slices in n segment of #duration each. outFilePath is an expression (OUT%03d.mp4 for example) so ffmpeg creates one file/segment --> <command enabled="true" name="videoSlicerSegments"> <commandLine>ffmpeg</commandLine> <parameterString>-y -i #{sourceFilePath} -map 0 -c copy -f segment -segment_time #{duration} -reset_timestamps 1 #{outFilePath} </parameterString> <installationDirective>You need to install ffmpeg.</installationDirective> </command> <!-- filterComplex is the full filter. For example: "overlay=10:10" --> <command enabled="true" name="videoWatermarkWithPicture"> <commandLine>ffmpeg</commandLine> <parameterString>-y -i #{sourceFilePath} -i #{pictureFilePath} -filter_complex #{filterComplex} #{outFilePath} </parameterString> <installationDirective>You need to install ffmpeg.</installationDirective> </command> </extension>
-
<extension point="command" target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent"> <command enabled="true" name="toThumbnail"> <commandLine>convert</commandLine> <parameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -strip -thumbnail #{size} -background transparent -gravity center -format png -quality 75 #{inputFilePath}[0] #{outputFilePath}</parameterString> <winParameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet -strip -thumbnail #{size} -background transparent -gravity center -format png -quality 75 #{inputFilePath}[0] #{outputFilePath}</winParameterString> <installationDirective>You need to install ImageMagick.</installationDirective> </command> </extension>
-
<extension point="command" target="org.nuxeo.ecm.platform.commandline.executor.service.CommandLineExecutorComponent"> <command enabled="true" name="resizeAvatar"> <commandLine>convert</commandLine> <parameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet #{sourceFilePath}[0] jpg:- | convert - -resize #{targetWidth}x#{targetHeight}> #{targetFilePath}</parameterString> <winParameterString>-define registry:temporary-path=#{nuxeo.tmp.dir} -quiet #{sourceFilePath}[0] -resize #{targetWidth}x#{targetHeight}> #{targetFilePath}</winParameterString> <installationDirective>You need to install ImageMagick.</installationDirective> </command> </extension>